<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('角色管理')" />
</head>
<body>
<a th:href="@{/system/role/new}">新增</a>

<table id="bootstrap-table"></table>

</body>
<th:block th:include="include :: footer" />

<script th:inline="javascript">


    $(function () {
        $('#bootstrap-table').bootstrapTable({
            url: './role/query',
            pagination: true,
            search: false,
            sidePagination: 'server',
            showPaginationSwitch: false,
            locale: 'zh-CN',
            columns: [{
                field: 'name',
                title: '角色名称'
            }, {
                field: 'createTime',
                title: '创建时间'
            }, {
                field: 'updateTime',
                title: '修改时间'
            }],
            queryParams: function(param){
                console.log(param);
                return {
                    page: param.offset / param.limit,
                    size: param.limit
                };
            },
            responseHandler: function (result) {
                var content = {
                    total : result.data.totalElements,
                    rows:result.data.content
                };
                return content;
            }
        })
    })


</script>
</html>
